package com.nulldev.util.web.nTube.pages.invidious_compat;

import com.nulldev.util.languages.json.uniapi.UniJsonValue;
import com.nulldev.util.web.HttpServer3.Response;
import com.nulldev.util.web.HttpServer3.pages.v3.HttpPage3;

/**
 * nTube doesn't track what the users are watching.
 * 
 * [Spongebob OST - Steel Sting]
 */
public class APIPopular extends HttpPage3 {

	public APIPopular() {
		super("/api/v1/popular");
		this.setCachingMethod(CachingMethod.VERY_SHORT_CACHE);
		this.setChecks(EnhancedSecurityChecks.DISALLOW_POST_DATA, EnhancedSecurityChecks.ONLY_ALLOW_BASIC_METHODS);
	}

	@SuppressWarnings("resource")
	@Override
	public Response onRequest(final Request request) {
		final UniJsonValue v = UniJsonValue.array();
		return new Response(200, v, v).setCustomMime("application/json");
	}
}
